package com.zhiyu.service;

import com.zhiyu.entity.VO.ResponseVO;
import com.zhiyu.exception.EncryptException;
import javafx.util.Pair;
import org.springframework.stereotype.Service;

@Service
public interface EncryptService {
    /**
     * 获取公钥
     *
     * @return 返回公钥
     */
    public ResponseVO getRSAPublicKey(String username);

    /**
     * 对比加密字符串解密后是否和目标字符串一致
     *
     * @param encryptedString 加密后的字符串
     * @param targetString 目标字符串
     * @param privateKey 解密所用私钥
     * @return
     */
    public boolean verify(String encryptedString, String targetString, String privateKey);

    /**
     *
     * @param toDecryptString 要解密的字符串
     * @param privateKey 解密用的私钥
     * @return
     */
    public String RSADecrypt(String toDecryptString, String privateKey);

    /**
     * 获取privateKey在redis中存放的字段
     * @return
     */
    public String getPrivateKeyField();
}
